package me.send.produce.data.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import me.send.data.service.pojo.ZTree;
import me.send.data.service.service.TreeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("tree")
public class TreeController {
	
	@Autowired
	private TreeService treeService;
	
	@RequestMapping("tree/list")
	@ResponseBody
	public List<ZTree> tree_list(){
		return treeService.list(0);
	}
	
	@RequestMapping(value="main/tree")
	@ResponseBody
	public Map<String, Object> main_tree(HttpServletRequest request){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("data", treeService.main_tree(0,request,null));
		return map;
	}
	
}
